package com.alison.tableapisql.chapter1_tableapiandsql.model;

import lombok.Data;

import java.io.Serializable;

/**
 * @Author alison
 * @Date 2024/4/8 10:53
 * @Version 1.0
 * @Description
 */
@Data
public class SensorReading implements Serializable {

    public String id;
    public long timestamp;
    public double temperature;

    public SensorReading() {
    }

    public SensorReading(String id, long timestamp, double temperature) {
        this.id = id;
        this.timestamp = timestamp;
        this.temperature = temperature;
    }

    public static SensorReading of(String id, long timestamp, double temperature){
        return  new SensorReading(id, timestamp, temperature);
    }
}
